package com.example;

import com.example.bean.Resume;
import com.example.dao.ResumeDao;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@SpringBootApplication
public class MongoTemplateTest {

    public static void main(String[] args) throws ParseException {

        ApplicationContext applicationContext = SpringApplication.run(MongoTemplateTest.class, args);
        ResumeDao resumeDao = applicationContext.getBean("resumeDao",ResumeDao.class);
/*        Resume resume = new Resume();
        resume.setName("zoro");
        resume.setCity("上海");

        Date date = null;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Date parse = simpleDateFormat.parse("2020-03-11 11:11:11");

        resume.setBirthday(parse);
        resume.setExpectSalary(180000);
        resumeDao.insertResume(resume);*/
        Resume resume = resumeDao.findByName("zoro");
        System.out.println(resume);

/*        List<Resume> resumeList = resumeDao.findListByNameAndExpectSalary("zoro", 180000);
        System.out.println(resumeList);*/

    }

}
